/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.breakaway.ballControl;

import com.team1160.breakaway.api.Constants;
import com.team1160.breakaway.model.Model;
import com.team1160.breakaway.model.ModelNotifier;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Victor;

/**
 *
 * @author Team 1160 Firebird Robotics (Saketh Kasibatla, Solomon Chang)
 */
 public class Dribbler implements ModelNotifier{
    /**
     * This is the motor that runs the dribbler.
     */
    protected Victor motor;

    /**
     * the dribbler constructor
     * @param model the model that the dribbler updates.
     */
    public Dribbler()
    {
        motor = new Victor(Constants.C_DR_VICTOR);
    }

    /**
     * Updates the model
     */
    public void updateModel(Model model)
    {
        model.setDribblerMotor(this.motor.get());
    }

    /**
     * starts the dribbler.
     */
    public void start(double speed){
        this.motor.set(speed);
    }

    /**
     * stops the dribbler
     */
    public void stop(){
        this.motor.set(0.0);
    }

}
